-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor InternalUsers REST API test #4481
Refactor InternalUsers REST API test #4481
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4481 +/- ##
==========================================
- Coverage 65.17% 65.00% -0.18%
==========================================
Files 313 313
Lines 22053 22064 +11
Branches 3561 3562 +1
==========================================
- Hits 14374 14342 -32
- Misses 5904 5941 +37
- Partials 1775 1781 +6
|
82ee674
to
0961547
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @willyborankin for the changes, tests look much better now! Code changes look good to me, minor comment around adding comments in tests.
...java/org/opensearch/security/api/InternalUsersRegExpPasswordRulesRestApiIntegrationTest.java
Show resolved
Hide resolved
f2ef3d2
to
7beb272
Compare
src/integrationTest/java/org/opensearch/security/api/InternalUsersRestApiIntegrationTest.java
Show resolved
Hide resolved
@willyborankin Are there additional use-cases that need to be included to ensure the coverage is not decreased with migrating the tests to integrationTest framework? |
7beb272
to
6ef65d9
Compare
Good point, I did not revert change which I made. Hope it will be better |
...java/org/opensearch/security/api/InternalUsersRegExpPasswordRulesRestApiIntegrationTest.java
Show resolved
Hide resolved
src/integrationTest/java/org/opensearch/security/api/InternalUsersRestApiIntegrationTest.java
Show resolved
Hide resolved
src/integrationTest/java/org/opensearch/security/api/InternalUsersRestApiIntegrationTest.java
Show resolved
Hide resolved
src/integrationTest/java/org/opensearch/security/api/InternalUsersRestApiIntegrationTest.java
Show resolved
Hide resolved
src/integrationTest/java/org/opensearch/security/api/InternalUsersRestApiIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/dlic/rest/api/InternalUsersApiAction.java
Show resolved
Hide resolved
6ef65d9
to
1b1cc89
Compare
@cwperks the different in the test coverage is due to |
Split up UserApiTest into 3 diff tests: - InternalUsersRestApiIntegrationTest - InternalUsersRegExpPasswordRulesRestApiIntegrationTest - InternalUsersScoreBasedPasswordRulesRestApiIntegrationTest Fixes: - Added validation for the security roles for PATCH - Added validation for restricted character in username for PATCH Signed-off-by: Andrey Pleskach <ples@aiven.io>
1b1cc89
to
7552b0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! @willyborankin
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.x
# Create a new branch
git switch --create backport/backport-4481-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a588bdd4f09aff813ef0ebfce051246740680ae6
# Push it to GitHub
git push --set-upstream origin backport/backport-4481-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.x Then, create a pull request where the |
Signed-off-by: Andrey Pleskach <ples@aiven.io> (cherry picked from commit a588bdd)
Signed-off-by: Andrey Pleskach <ples@aiven.io> (cherry picked from commit a588bdd)
Description
Split up
UserApiTest
into 3 diff tests:InternalUsersRestApiIntegrationTest
InternalUsersRegExpPasswordRulesRestApiIntegrationTest
InternalUsersScoreBasedPasswordRulesRestApiIntegrationTest
Fixes:
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.